<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>平台组件管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../css/font.css">
    <link rel="stylesheet" href="../css/xadmin.css">
    <script type="text/javascript"
            src="../lib/vue/jquery.min.js"></script>
    <script type="text/javascript" src="../lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="../js/xadmin.js"></script>
    <script type="text/javascript" src="../js/global.js"></script>
    <script type="text/javascript" src="../js/store.js"></script>
    <script type="text/javascript" src="../js/cookies.js"></script>
    <script src="../lib/vue/vue.min.js"></script>
    <script src="../lib/vue/axios.min.js"></script>
</head>

<body>
<div class="x-body layui-anim layui-anim-up" id="managerAdd">
    <form class="layui-form">
        <div class="layui-form-item" hidden>
            <div class="layui-input-inline">
                <input type="text" id="L_applicationId" name="applicationId" required=""
                       lay-verify="" autocomplete="off" class="layui-input">
            </div>
        </div>

        <div class="layui-form-item">
            <label for='L_handingResult' class="layui-form-label">
                <span class="x-red">*</span>审核意见
            </label>
            <div class="layui-input-inline" id="L_handingResult">
                同意<input type="radio" name="handingResult" value="1" checked>
                驳回<input type="radio" name="handingResult" value="2">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label" for="L_otherMsg">
                <span class="x-red">*</span>审核备注
            </label>
            <div class="layui-input-inline" style="width: 400px;" id="L_otherMsg">
            <textarea rows="10" cols="30" name="otherMsg" placeholder="如同意可忽略此框，否则请输入驳回原因,如：组件正在升级维护。。。"></textarea>
            </div>
        </div>
        <div class="layui-form-item" style="padding-top: 100px">
            <label class="layui-form-label">
            </label>
            <button class="layui-btn" lay-filter="examine" lay-submit="examine">
                保存
            </button>
        </div>
    </form>
</div>
<script>
    layui.use(['form', 'layer'], function () {
            $ = layui.jquery
            let form = layui.form
                , layer = layui.layer;
            //获取选中的数据 进行格式转换，并加载到form表单中
            var editData = parent.$("#editRequestion").val();
            var editArray = JSON.parse(editData);

            $('#L_applicationId').val(editArray.id);

            //自定义验证规则
            form.verify({
                userName: function (value) {
                    if (value.length < 1) {
                        return '用户名不可为空'
                    }
                }
            });
            //监听提交
            form.on('submit(examine)', function (data) {
                $.putForm(_hostUrl + "/cmsCheckInfo", data.field, function (res) {
                    if (res.responseCode == 201) {
                        layer.msg('操作成功', {
                            icon: 1,
                            time: 2000
                        }, function () {
                            // 获得frame索引
                            var index = parent.layer.getFrameIndex(window.name)
                            //关闭当前frame
                            parent.layer.close(index)
                            var table = parent.window.layui.table;
                            table.reload('requestionList')
                        });
                    } else {
                        layer.msg(res.responseMsg, {icon: 2, time: 1500})
                    }
                }, 'json');
                return false
            });
        }
    )
</script>
</body>

</html>